#
# this module look for p3dfft  library for parallel 3d fft
#
# P3DFFT_INCLUDE_DIR = where p3dfft.h and p3dfft.mod are located
# P3DFFT_LIBRARY = libp3dfft.a
#

SET(TRIAL_PATHS
  $ENV{P3DFFT_HOME}/include
  /usr/include
  /usr/local/include
  /opt/include
  /usr/apps/include
  )
FIND_PATH(P3DFFT_INCLUDE_DIR p3dfft.h ${TRIAL_PATHS})

SET(TRIAL_LIBRARY_PATHS
  $ENV{P3DFFT_HOME}/lib
  /usr/lib 
  /usr/local/lib
  /opt/lib
  /sw/lib
  )

FIND_LIBRARY(P3DFFT_LIBRARY p3dfft ${TRIAL_LIBRARY_PATHS})

if(P3DFFT_LIBRARY)
  SET(P3DFFT_FOUND 1 CACHE BOOL "Found p3dfft library")
else(P3DFFT_LIBRARY)
  SET(P3DFFT_FOUND 0 CACHE BOOL "Not found p3dfft library")
endif(P3DFFT_LIBRARY)

MARK_AS_ADVANCED(
   P3DFFT_INCLUDE_DIR
   P3DFFT_LIBRARY
   P3DFFT_FOUND
)
